package com.mayikt.service;

import com.mayikt.dao.FlightDao;
import com.mayikt.entity.FlightEntity;
import com.mayikt.utils.MayiktJdbcUtils;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.util.Date;
import java.util.List;


public class FlightService {
    // 业务逻辑调用数据库访问层获取数据
    private FlightDao flightDao = new FlightDao();

    /**
     * 查询所有的航班信息
     *
     * @return
     */
    public List<FlightEntity> getByAll() {
        return flightDao.getByAll();
    }

    public FlightEntity getByIdFlight(Integer id) {
        return flightDao.getByIdFlight(id);
    }
    // FlightService.java 修改方法
    public int deleteFlightById(int id) {
        return flightDao.deleteFlight(id);
    }

    public int insertFlight(FlightEntity flightEntity){
        return flightDao.insertFlight(flightEntity);
    }


}
